const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ConsoleLogOnBuildWebpackPlugin = require('./plugins/log');
const webpack = require('webpack');

const config = (env) => {
  return {mode: 'development',
  entry: {
    a1: './src/index.js',
    a2: {
      dependOn: 'a1',
      import: './src/index2.js'
    },
  },
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: '[name].js',
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: path.resolve(__dirname, './index.template.html'),
    }),
    new ConsoleLogOnBuildWebpackPlugin(),
  ]
}};

const compiler = webpack(config(), (err, state) => {
});